package com.lvmama.rhino.enums;

/**
 * @Author:caoyong
 * @Description: 订单状态枚举
 * @Date：2017/10/18
 */
public enum  OrderTypeEnum {
    ALL("","全部"),
    PENDING_PAYMENT("WAIT_PAY", "待支付"),
    PAID("PAYED", "已支付"),
    CANCELED("CANCEL", "已取消"),
    REFUNDED("REFUNDED", "已退款"),
    REFUNDING("REFUNDING", "退款中"),
    COMPLETE("COMPLETE", "已完成"),
    WAIT_VISIT("WAIT_VISIT", "待出票"),
    UNDER_REVIEW("UNVERIFIED","审核中"),
    LEAVE_HOTEL("LEAVE_HOTEL","已离店"),
    TRIPING("TRIPING","旅途中"),
    WAIT_HOTEL("WAIT_HOTEL","待入住"),
    IN_HOTEL("IN_HOTEL","已入住");


    private String code;
    private String showName;

    OrderTypeEnum(String code, String showName) {
        this.code = code;
        this.showName = showName;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getShowName() {
        return showName;
    }

    public void setShowName(String showName) {
        this.showName = showName;
    }

    /**
     * 获取枚举
     * @param code
     * @return
     */
    public static OrderTypeEnum getEnum(String code){
        for (OrderTypeEnum en : OrderTypeEnum.values()){
            if(en.getCode().equals(code)){
                return en;
            }
        }
        return null;
    }
}
